package cn.kgc.service;

import cn.kgc.dao.UserDao;
import cn.kgc.dao.UserDaoImpl;
import cn.kgc.pojo.User;

/**
 * @author Rock
 * @create 2020-08-17 11:16
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao= new UserDaoImpl();
    @Override
    public User login(String userName, String password) {
        User loginUser = null;
        loginUser = userDao.getUserByUserName(userName);
        if (loginUser != null){ //用户名存在
            if (!loginUser.getPassword().equals(password)) {
                loginUser = null;
            }
        }
        return loginUser;
    }
}
